package app.android.alampang.ui.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import app.android.alampang.R;
import app.android.alampang.loader.FontLoader;
import app.android.alampang.ui.core.BaseActivity;
import app.android.alampang.utility.NavigationService;


public class HomeActivity extends BaseActivity implements View.OnClickListener {
    private View mLocation;
    private View mMap;
    private View mCommunity;
    private View mNote;


    @Override
    public void onCreate(Bundle savedInstanceState, Bundle param) {
        setContentView(R.layout.activity_home);
    }

    private void setFont() {
        // title

        //menu
        TextView m1 = (TextView) findViewById(R.id.txt_menu_place);
        TextView m2 = (TextView) findViewById(R.id.txt_menu_map);
        TextView m3 = (TextView) findViewById(R.id.txt_menu_community);
        TextView m4 = (TextView) findViewById(R.id.txt_menu_note);

        m1.setTypeface(FontLoader.getFont(this, FontLoader.TH_KRUB));
        m2.setTypeface(FontLoader.getFont(this, FontLoader.TH_KRUB));
        m3.setTypeface(FontLoader.getFont(this, FontLoader.TH_KRUB));
        m4.setTypeface(FontLoader.getFont(this, FontLoader.TH_KRUB));
    }


    @Override
    public void initialize() {
        mLocation = this.findViewById(R.id.menu_place);
        mMap = this.findViewById(R.id.menu_map);
        mCommunity = this.findViewById(R.id.menu_community);
        mNote = this.findViewById(R.id.menu_note);

        mLocation.setOnClickListener(this);
        mMap.setOnClickListener(this);
        mCommunity.setOnClickListener(this);
        mNote.setOnClickListener(this);

        setFont();
    }

    @Override
    public void onLock() {

    }

    @Override
    public void onUnLock() {

    }

    @Override
    public void onReset() {

    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.menu_place:
                NavigationService
                        .getInstance()
                        .navigate(this, MenuPlaceActivity.class, false);
                break;
            case R.id.menu_map:
                NavigationService
                        .getInstance()
                        .navigate(this, MapsActivity.class, false);
                break;
            case R.id.menu_community:
                NavigationService
                        .getInstance()
                        .navigate(this, CommunityActivity.class, false);
                break;
            case R.id.menu_note:
                NavigationService
                        .getInstance()
                        .navigate(this, NotesActivity.class, false);
                break;
        }
    }

}
